package prototypePattern

/**
 * 邮件
 */
class Mail(
    //标题
    var subject: String,
    //内容
    var content: String
) : Cloneable {
    //收件人
    var receiver: String? = null

    fun cloneObj(): Mail? {
        var mail: Mail? = null
        try {
            mail = super.clone() as Mail
        } catch (e: CloneNotSupportedException) {
            e.printStackTrace()
        }
        return mail
    }
}